﻿<UserControl x:Class="DanielVaughan.Logging.Silverlight.UI.LogViewer"
    xmlns="http://schemas.microsoft.com/client/2007" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="500" Height="500">
	<UserControl.Resources>
		<Style x:Key="LogPanel" TargetType="StackPanel">
			<Setter Property="Margin" Value="10"/>
			<Setter Property="Width" Value="55"/>
			<Setter Property="Height" Value="55"/>
			<Setter Property="Background">
				<Setter.Value>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="#FFFFF098"/>
						<GradientStop Color="#FFFFF9D4" Offset="1"/>
					</LinearGradientBrush>
				</Setter.Value>
			</Setter>
		</Style>

		<Style x:Key="LogLevel" TargetType="TextBlock">
			<Setter Property="HorizontalAlignment" Value="Center"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
			<Setter Property="FontSize" Value="11"/>
			<Setter Property="FontWeight" Value="Bold"/>
			<Setter Property="Foreground" Value="DarkSlateGray"/>
		</Style>

		<Style x:Key="OccuredAt" TargetType="TextBlock">
			<Setter Property="HorizontalAlignment" Value="Center"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
			<Setter Property="FontSize" Value="11"/>
			<Setter Property="Foreground" Value="DarkSlateGray"/>
		</Style>

		<Style x:Key="TitleBlock" TargetType="TextBlock">
			<Setter Property="FontFamily" Value="Trebuchet MS"/>
			<Setter Property="TextAlignment" Value="Left"/>
			<Setter Property="VerticalAlignment" Value="Top"/>
			<Setter Property="FontSize" Value="12"/>
			<Setter Property="TextWrapping" Value="Wrap"/>
		</Style>
	</UserControl.Resources>
	
	
    <Grid x:Name="LayoutRoot" Background="White">
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*"/>
			<ColumnDefinition Width="200"/>
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="auto" />
			<RowDefinition Height="auto" />
		</Grid.RowDefinitions>
		<StackPanel>
			<TextBlock>Log Entries:</TextBlock>
			<ListBox x:Name="ListBox_Entries" Height="250">
				<ListBox.ItemTemplate>
					<DataTemplate>
						<StackPanel Orientation="Horizontal">
							<StackPanel>
								<TextBlock Text="{Binding OccuredAt}" Style="{StaticResource OccuredAt}" /> 
							<TextBlock Text="{Binding LogLevel}" Style="{StaticResource LogLevel}" />                                                                                   
						</StackPanel>
							<!-- Log Entry Title-->
							<TextBlock Text="{Binding Message}" Margin="5" Style="{StaticResource TitleBlock}"/>
                    </StackPanel>
					</DataTemplate>
				</ListBox.ItemTemplate>
				<Border Padding="3" Background="#E6BB8A" CornerRadius="5">
					<ScrollViewer x:Name="ScrollViewerElement">
						<ItemsPresenter />
					</ScrollViewer>
				</Border>
			</ListBox>
		</StackPanel>
		<TextBlock x:Name="TextBlock_Entry" Grid.Column="1" Grid.Row="0" TextWrapping="Wrap" VerticalAlignment="Top"></TextBlock>
		<StackPanel Grid.ColumnSpan="2" Grid.Row="2">
			<TextBlock>Internal Messages:</TextBlock>
			<ScrollViewer>
				<TextBox x:Name="TextBlock_Messages"></TextBox>
			</ScrollViewer>
		</StackPanel>

		<!--<TextBlock x:Name="TextBlock_Version" Grid.ColumnSpan="2" Grid.Row="3"></TextBlock>-->
    </Grid>
</UserControl>
